package io.datajek.springbasics.movierecommendersystem.lesson12;

import io.datajek.springbasics.movierecommendersystem.lesson2.Filter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

@Component
@Qualifier("cbf")
public class ContentBasedFilter implements Filter {
    private Logger logger= LoggerFactory.getLogger(this.getClass());
    public ContentBasedFilter() {
        super();
        logger.info("In ContentBasedFilter constructor method");
    }
    @PostConstruct
    public void postConstruct(){
        logger.info("In ContentBasedFilter constructor method");
    }
    @PreDestroy
    public void PreDestroy(){
        System.out.println("In ContentBasedFilter preDestroy method");
    }



    public String[] getRecommendations(String movie){
        //基于内容的过滤器的逻辑

        //return movie recommendations
        return new String[]{"逃学威龙","逃学威龙2","ice age"};
    }

}
